# encoding=utf-8

import sqlite3


con = sqlite3.connect('/Users/graceli/project/PythonTestProject/my02/数据表/demo.db')

cur = con.cursor()

# sql = 'update t_person set pname=? where pno=?'
delData = 'delete from t_person where pno=?'
try:
    # cur.execute(sql,('小张', 1))
    cur.execute(delData,(1,))
    con.commit()
except Exception as e:
    print(e)
    print('修改失败')
    con.rollback()
finally:
    cur.close()
    con.close()